package Basic;

public class armstrog {
    public static void main(String[] args){
		int a,b,c;
		for(a=1;a<10;a++){
			for(b=1;b<10;b++){
				for(c=1;c<10;c++){
					if(a*a*a+b*b*b+c*c*c>=1000)
						break;
					//System.out.printf("%d %d %d%n",a,b,c);
					if(100*a+10*b+c==a*a*a+b*b*b+c*c*c)
						System.out.printf("%d%n",a*a*a+b*b*b+c*c*c);
				}
			}
			
			
		}
	}
}
	